package com.yc.multiple.dao.paycenter;

import com.yc.multiple.bean.paycenter.Paycenter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class PaycenterDao {

    @Autowired()
    @Qualifier("paycenterJdbcTemplate")
    private JdbcTemplate jdbcTemplate;
    public List<Paycenter> selectAll(){
        String sql="select paycenter_id as paycenterId,paycenter_name as paycenterName from paycenter_test";
        return jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(Paycenter.class));
    }
}
